GStreamer Examples for the Dragonwing EVK Board
These GStreamer pipelines are progressive IQ-9075 smoke tests: start with a synthetic source, then validate software codecs, hardware video encode, camera capture and transform.
Problems running the pipelines shown on this page? Please see our
GStreamer Debugging guide for help
.
Example Pipelines
The pipelines presented in this page were tested on the Ubuntu 24.04 Image.
For more advanced examples, please visit the following links:
For acceleration testing, you can also use the following links:
Simple videotestsrc pipeline
The following pipeline captures video from a synthetic source and renders it on display:
gst-launch-1.0 -v videotestsrc ! autovideosink
Expected Result:
Smooth image of the test pattern generated.
Video saving in MP4 format (Software Encoding)
The following pipeline captures from a synthetic video source, encodes with h.264 codec and stores the video in a mp4 container file:
gst-launch-1.0 -v videotestsrc num-buffers=300 ! videoconvert ! x264enc ! mp4mux ! filesink location=test-video.mp4
Expected Result:
MP4 file generated correctly.
Video playing of an MP4 file (Software Decoding)
The following pipeline decodes a mp4 video file and renders it to display:
gst-launch-1.0 -v filesrc location=test-video.mp4 ! qtdemux ! h264parse ! avdec_h264 ! autovideosink
Expected Result:
MP4 video played correctly
Video saving in MP4 format (VPU-accelerated Encoding)
The following pipeline captures from a camera, encodes the video with the hardware codec and stores it as an mp4 file:
gst-launch-1.0 -e -v qtiqmmfsrc camera=0 ! "video/x-raw,format=NV12,width=1920,height=1080,framerate=30/1,interlace-mode=progressive,colorimetry=bt601" ! v4l2h264enc capture-io-mode=4 output-io-mode=5 extra-controls="controls,video_bitrate=12000000,video_bitrate_mode=0;" ! h264parse ! mp4mux ! filesink location=v4l2h264enc-camera-encoding.mp4
Expected Result:
MP4 file generated correctly
Video playing of an MP4 file (VPU-accelerated Decoding)
The following pipeline decodes an mp44 video with hardware acceleration and renders it to display:
gst-launch-1.0 -e -v filesrc location=v4l2h264dec.mp4 ! qtdemux ! h264parse ! v4l2h264dec ! waylandsink
Expected Result:
MP4 video played correctly
Camera recording with qtiqmmfsrc element
The following pipeline captures from camera, encodes using the hardware codec and stores the video to an mp4 file:
gst-launch-1.0 -e qtiqmmfsrc name=camsrc camera=0 ! \ video/x-raw,format=NV12,width=1280,height=720,framerate=30/1,\ interlace-mode=progressive,colorimetry=bt601 ! v4l2h264enc \ capture-io-mode=4 output-io-mode=5 extra-controls="controls,video_bitrate=6000000,\ video_bitrate_mode=0;" ! h264parse ! mp4mux ! filesink location=camera-test.mp4
Expected Result:
MP4 video generated correctly
Video Transformation with qtivtransform
The following pipeline captures from camera, rotates the video, encodes with hardware acceleration and saves the result to a mp4 file:
gst-launch-1.0 -e -v qtiqmmfsrc camera=0 ! "video/x-raw,format=NV12,width=1920,height=1080,framerate=30/1" ! qtivtransform rotate=1 ! v4l2h264enc capture-io-mode=4 output-io-mode=5 extra-controls="controls,video_bitrate=12000000,video_bitrate_mode=0;" ! h264parse ! mp4mux ! filesink location=qtivtransform-example.mp4
Expected Result:
MP4 video generated correctly with expected transformation (rotation)
Video Transformation with gltransform
The following pipeline captures from a synthetic source, uses the gl elements to perform a rotation on the Z axis, encodes the video with hardware codec and stores it to a mp4 file:
gst-launch-1.0 -v videotestsrc num-buffers=300 ! glupload ! gltransformation rotation-z=45 ! glcolorconvert ! gldownload ! video/x-raw,format=NV12 ! v4l2h264enc ! h264parse ! mp4mux ! filesink location=gpu-transformation.mp4
Expected Result:
MP4 video generated correctly with expected transformation (a rotation in Z axis)
FAQ
- Why start with videotestsrc?
- A synthetic source isolates GStreamer, caps negotiation, codec, and display behavior from camera hardware, making it the simplest starting point for building video pipelines.
- What to do if the pipeline fails?
- Inspect the command line output for warnings and errors. If this does not provide information, increase the debug level, see GStreamer Debugging.
Related pages
- Qualcomm Dragonwing Technical Guide/GStreamer/Enable Support
- Qualcomm Dragonwing Technical Guide/GStreamer/Performance
- Qualcomm Dragonwing Technical Guide/Multimedia Support/Video/Capture
- Qualcomm Dragonwing Technical Guide/Multimedia Support/Video/Encoding
- GStreamer
References